package QiYi;

import java.util.Scanner;

public class Sqrt {

    public static int getTotal(int m, int n) {
        int big = m > n ? m : n;
        int min = m < n ? m : n;
        int num = min;
        for (int i = 1; i <= min; i++) {
            for (int j = i + 1; j <= big; j++) {
                int a = i * j;
//                double b = Math.sqrt(a);
//                int k = (int) b;

                if (isSquare(a)) {
                    if (j <= min)
                        num += 2;
                    else num++;
                }
            }
        }
        return num;
    }

    private static boolean isSquare(int num) {
        int i;
        for (i = 1; num > 0; i += 2) {
            num -= i;
        }
        if (num == 0) {
            return true;
        } else return false;

    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        System.out.println(getTotal(m, n));
    }

}
